*------------------------------------------------------------------------------*
* Backsliding by Surprise: The Rise of Chavismo		  						   *
* Dorothy Kronick, Barry Plunkett, Pedro Rodríguez	                           *
* Corresponding author: Dorothy Kronick (kronick@berkeley.edu)                 *
* Last modification: 09/14/2022                                                *
* Version of Stata: Stata MP 17.0 6-core                                       *
* -----------------------------------------------------------------------------*
* Additional programs needed:                                                  *
* 1.) lincomest can be obtained by running "ssc install lincomest, replace"    *
* -----------------------------------------------------------------------------*


*------------------------------*
* 1.) CHOOSE working directory *
*------------------------------*
cd "/Users/kronick/Riker/Replication"


*-------------------*
* 2.) Preliminaries *
*-------------------*
cap log close
log using "log/logStata", replace
clear all

* deleting outputs so that everything is newly produced
foreach x in "figures" "tables" {
	local files: dir "`x'" files *
	foreach file of local files {
	        rm "`x'/`file'"
	}
}


*-------------------------------*
* 3.) Create tables and figures *
*-------------------------------*

do "code_Stata/0_PrepSurveyData.do"
	
do "code_Stata/1_Figure1.do"
do "code_Stata/2_Figure2.do"
do "code_Stata/3_Figure3.do"
do "code_Stata/4_Figure4.do"
	
do "code_Stata/5_TableB1.do"
do "code_Stata/6_TableB2.do"
do "code_Stata/7_TableB3.do"

do "code_Stata/8_TableC1.do"

do "code_Stata/9_FigureD1.do"
do "code_Stata/10_FigureD2.do"
do "code_Stata/11_FigureD3.do"

do "code_Stata/12_FigureE4.do"
	
*------------------------------------------------------------------------------*
log close
clear all
